﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FrameworkXNA
{
    static class SceneManager
    {
        public static SceneBase currentScene;

        public static void setScene(SceneBase scene)
        {
            if (currentScene != null)
            {
                currentScene.terminate();
            }

            currentScene = scene;

            if (currentScene != null)
            {
                currentScene.start();
            }
        }

        public static void Update(GameTime gameTime)
        {
            if (currentScene != null)
            {
                currentScene.update(gameTime);
            }
        }

        public static void Draw(SpriteBatch spriteBatch)
        {
            if (currentScene != null)
            {
                currentScene.draw(spriteBatch);
            }
        }
    }
}
